﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;

namespace EasyCore.UnifyResult.Results
{
    /// <summary>
    /// 简易的API结果
    /// </summary>
    public interface IEasyApiResult
    {
        /// <summary>
        /// 状态码
        /// </summary>
        public int StatusCode { get; set; }
        
        /// <summary>
        /// 错误信息
        /// </summary>
        public string? Message { get; set; }

        /// <summary>
        /// 时间戳
        /// </summary>
        public long Timestamp { get; set; }

    }

    /// <summary>
    /// 返加数据的泛型结果接口
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IEasyApiResult<T> : IEasyApiResult
    {
        /// <summary>
        /// 返回的数据
        /// </summary>
        public T? Data { get; set; }
    }

    /// <summary>
    /// 错误信息提供的接口
    /// </summary>
    public interface IEasyApiErrorResult
    {
        /// <summary>
        /// 详细的错误信息：异常信息或参数【用于保存模型验证失败的错误信息】
        /// </summary>
        public Dictionary<string, object> ErrorData { get; set; }
    }








}
